<!-- crawler/templates/base.html -->
<!DOCTYPE html>
<html>
<head>
    <title>{{ system_name|default:"数据系统" }}</title>
    <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.1.3/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
    <div class="container">
        <a class="navbar-brand" href="{% url 'lottery-list' %}">
            {{ system_name|default:"数据系统" }}
        </a>
        <div class="navbar-nav">
            {% if user.is_authenticated %}
                <span class="nav-item nav-link">
                    欢迎，{{ user.username }}
                    <span class="badge bg-success ms-2">积分: {{ user.profile.score }}</span>
                </span>
                <form action="{% url 'logout' %}" method="post" class="d-inline">
                    {% csrf_token %}
                    <button type="submit" class="nav-link btn btn-link">退出</button>
                </form>
            {% else %}
                <a class="nav-item nav-link" href="{% url 'login' %}">登录</a>
            {% endif %}
        </div>
    </div>
</nav>
<div class="container mt-4">
    {% block content %}{% endblock %}
</div>
</body>
</html>